<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFansTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('fans',function (Blueprint $table){
            $table->engine = 'InnoDB';
            $table->bigIncrements('id');
            $table->bigInteger('fan_id')->default(0)->comment('粉丝id');
            $table->bigInteger('star_id')->default(0)->comment('被关注者id');
            $table->integer('created_id')->default(0)->comment('关注时间');
            $table->integer('updated_id')->default(0)->comment('修改时间');
            $table->index('fan_id');
            $table->index('star_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('fans');
    }
}
